package com.shop2cn.iapi.couponmanage.service;

import org.json.JSONObject;

import com.shop2cn.iapi.couponmanage.parameter.BatchInfo;
import com.shop2cn.iapi.couponmanage.parameter.sellerBatchInfos;
import com.shop2cn.iapi.couponmanage.parameter.ValidBatchInfos;
import com.shop2cn.iapi.couponmanage.parameter.batchInfos;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
/**
*商家查询有效的优惠券列表接口Call
*FreeMaker Template自动生成代码
*/
public class QueryValidBatchListCall extends YmatouBaseCall{
	private static String opurl ="api/SellerManage/QueryValidBatchList";
	
	public QueryValidBatchListCall() {
		super(EnvSetup.getSystemUrl("couponmanage_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		return getString("statusCode");		
	}

	/**
	 * 获取Message
	 * 
	 * @return
	 */
	public String getMessage() {
		return getString("message");	
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		return getString("data");	
	}

	public ValidBatchInfos getBatchInfos()
	{
		ValidBatchInfos data = null;
        try {
            data = (ValidBatchInfos) FormatUtil.GSONToObject(getData().toString(), ValidBatchInfos.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
	}
}